package gjw.reboundscrollview;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity implements ReboundScrollView.OnScrollChangedListener{

    private ReboundScrollView mReboundview;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mReboundview = (ReboundScrollView) findViewById(R.id.reboundview);
        mReboundview.setOnScrollChangedListener(this);
    }


    @Override
    public void onScrollChange(int offset) {
//        int height = rl_login_or_regist.getHeight();
//        if (offset <= height)
//        {
//            int percent = offset * 100 / height;
//            Log.e("onScrollChange", "percent: " + percent);
//            int alpha = 0xFF * percent / 100;
//            rl_titlebar.setBackgroundColor(Color.argb(alpha, 0xFF, 0xFF, 0xFF));
//            tv_titlebar.setTextColor(Color.parseColor("#ffffff"));
//        } else{
//            rl_titlebar.setBackgroundColor(Color.parseColor("#eeeeee"));
//            tv_titlebar.setTextColor(Color.parseColor("#af0000"));
//        }
    }
}
